<template>
	<div>
		<vhead></vhead>
		
		<div class="container" style="margin-top: 70px;">
			<div class="row">
				<div class="col-sm-9 film-left">
					<!--<div class="fl-head">
						<filmType :dataJson="resouseType"></filmType>
					</div>-->
					<listContent :dataJson="resouseAll"></listContent>
				</div>
			</div>
		</div>
		
		<vfoot></vfoot>
	</div>
</template>

<script>
	import Vhead from "../public/VHead"
	import ListContent from "../public/ListContent"
	import FilmType from "../public/FilmType"
	import VFoot from "../public/VFoot"
	import Qs from 'qs'
	export default {
		data () {
		    return {
		    	resouseType : [],
		    	resouseAll :[]
		    }
		},
		mounted ($route) {
	 		this.$nextTick(()=>{
	 			let _this = this; 
	 			
	 			//获取所有作品
        		_this.$axios({
                    method: "post",
                    url: "public/index.php/index/Resouse/findAllResouse",
                })
                .then(function(res) {
                	for(var i = 0;i<res.data.length;i++){
  						res.data[i]["imgUrl"] = 'public/uploads/'+res.data[i]["resouseUrl"] ;
  						res.data[i]["id"] = res.data[i]["resouseId"];
  						res.data[i]["name"] = res.data[i]["resouseName"];
  						res.data[i]["url"] = '/resouseDetail/'+res.data[i]["resouseId"];
  					}
                	_this.resouseAll = res.data;
               	})
                .catch(function(err) {
                   console.log(err);
               	});
	 			
	 			//获取所有作品的类型
	 			_this.$axios({
                    method: "post",
                    url: "public/index.php/index/Resousetype/findAllResousetype",
                })
                .then(function(res) {
                	for(var i = 0;i<res.data.length;i++){
  						res.data[i]["id"] = res.data[i]["id"];
  						res.data[i]["name"] = res.data[i]["name"];
  					}
                	_this.resouseType = res.data;
               	})
                .catch(function(err) {
                   console.log(err);
               	});
               	
	 		})
 		},
		components:{
			"vhead" : Vhead,
			"filmType" : FilmType,
			"vfoot" : VFoot,
			"listContent" : ListContent
		}
	}
</script>

<style scoped>
	.film-left{
		border-left: 1px solid #dfdfdf;
		border-right: 1px solid #dfdfdf;
	}
	.fl-head{
		border-bottom: 1px solid #dfdfdf;
	}
</style>